{include file="header" }
{include file="sibar" }


<div class="main-content">
    <div class="main-content-inner">
        <div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="{:U('index/index')}">首页</a>
                </li>
                <li>
                    <span>商品管理</span>
                </li>
                <li>
                    <span>商品分类</span>
                </li>
            </ul>
        </div>
        <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="row">
                        <div class="col-xs-12">
                            <p>
                                <a class="btn btn-primary" href="{:U('edit')}"><i class="ace-icon fa fa-plus"></i>添加</a>
                                <a class="btn btn-success"><i class="ace-icon fa fa-check"></i>启用</a>
                                <a class="btn btn-warning"><i class="ace-icon fa fa-ban"></i>禁用</a>
                                <a class="btn btn-danger"><i class="ace-icon fa fa-remove"></i>删除</a>
                            </p>
                            <table class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>排序</th>
                                    <th class="hidden-200">分类名称</th>
                                    <th>商品展示</th>
                                    <th class="text-center">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {foreach $goods_class as $item}
                                <tr>
                                    <td>{$item.gc_id}</td>
                                    <td>{$item.gc_sort}</td>
                                    <td>{$item.gc_name}</td>
                                    <td>{$item.show_type=='1'?'颜色':'SPU'}</td>
                                    <td class="text-center">
                                        <a type="button" class="btn btn-primary btn-sm">编辑</a>
                                        <a class="btn btn-sm btn-success">启用</a>
                                        <a class="btn btn-sm btn-warning">禁用</a>
                                        <a type="button" class="btn btn-danger btn-sm goods_class_del" id="{$item.gc_id}">删除</a>
                                    </td>
                                </tr>
                                {/foreach}
                                </tbody>
                            </table>
                            <div class="pull-right">
                                <ul class="pagination">
                                    <li class="disabled">
                                        <a href="#">
                                            <i class="ace-icon fa fa-angle-double-left"></i>
                                        </a>
                                    </li>
                                    <li class="active">
                                        <a href="#">1</a>
                                    </li>
                                    <li>
                                        <a href="#">2</a>
                                    </li>
                                    <li>
                                        <a href="#">3</a>
                                    </li>
                                    <li>
                                        <a href="#">4</a>
                                    </li>
                                    <li>
                                        <a href="#">5</a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            <i class="ace-icon fa fa-angle-double-right"></i>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $('.goods_class_del').click(function(){
            $.post('/admin/goods_class/delete',{id:this.id},function(info){
                if(info.code = 1){
                    alert(info.msg);
                    location.reload();
                }else{
                    alert(info.msg);
                }
            })
        });
    });
</script>
{include file="footer" }